import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopDispatchController } from '../../../controllers';
const uctoominishopDispatchRouter = new Router();
const minishopDispatchController = new uctooMinishopDispatchController();

uctoominishopDispatchRouter.post('/add', requireUser, minishopDispatchController.add);
uctoominishopDispatchRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_dispatch'), minishopDispatchController.edit);
uctoominishopDispatchRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_dispatch'), minishopDispatchController.delete);

//For getting minishopDispatch with permission control
uctoominishopDispatchRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_dispatch'), minishopDispatchController.getSingle);
uctoominishopDispatchRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_dispatch'), minishopDispatchController.getMany);
uctoominishopDispatchRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_dispatch'), minishopDispatchController.getMany);

//#endregion AutoCreateCode
export default uctoominishopDispatchRouter;
